# 配置基类
class Config:
    # 秘钥
    SECRET_KEY = '123456'
    # 数据库
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    # 缓存
    CACHE_TYPE = 'redis'
    CACHE_REDIS_HOST = '127.0.0.1'
    CACHE_REDIS_PORT = 6379
    CACHE_REDIS_DB = 1


# 开发环境配置
class DevelopConfig(Config):
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:970329@127.0.0.1:3306/blogs'


# 测试环境配置
class TestingConfig(Config):
    SQLALCHEMY_DATABASE_URI = 'TESTING'


# 生产环境配置
class ProductConfig(Config):
    SQLALCHEMY_DATABASE_URI = 'PRODUCT'


# 环境配置字典
config = {
    'develop': DevelopConfig,
    'testing': TestingConfig,
    'product': ProductConfig,
    # 默认环境
    'default': DevelopConfig
}
